package net.sf.tools.uiconfig.service;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import net.sf.tools.uiconfig.model.Configuration;
import net.sf.tools.uiconfig.model.Field;
import net.sf.tools.uiconfig.model.Menu;

/**
 * 
 * 		This interface should be implemented the party using the API for changing the dynamic visibility
 * of the fields.
 * 
 * @author sabuj.das
 *
 */
public interface UIConfigurationService {

	/**
	 * 
	 * @param request:HttpServletRequest
	 * @param arguments 
	 * 	<ul><li>The first value of the arguments[] represents uiFieldName</li> 
	 * 	<li>The first value of the arguments[] represents targetFieldName</li></ul>
	 * @return
	 */
	public boolean isVisible(HttpServletRequest request, String ... arguments);
	
	
	/**
	 * The target system should provide the UI configuration fields based on the pageName and the sectionName.
	 * The other required data should be taken from request and/or session.
	 * 
	 * @param request
	 * @param pageName
	 * @param sectionName
	 * @return
	 */
	public List<Field> loadFieldConfigurations(HttpServletRequest request, String pageName, String sectionName);
	
	
	/**
	 * The target system should provide the UI configuration sections for a particular page based on the pageName.
	 * The other required data should be taken from request and/or session.
	 * 
	 * @param request
	 * @param pageName
	 * @return
	 */
	public List<Configuration> loadSectionConfigurations (HttpServletRequest request, String pageName);
	
	/**
	 * The target system should provide the UI configuration menus based on the pageName and the sectionName.
	 * The other required data should be taken from request and/or session.
	 * 
	 * @param request
	 * @param pageName
	 * @param sectionName
	 * @return
	 */
	public List<Menu> loadMenuConfigurations(HttpServletRequest request, String pageName, String sectionName);
	
}
